<template>
  <el-space wrap direction="horizontal">
    <div
        v-for="item in items"
        :key="item.name"
        @click="item.action"
        class="glass-card"
    >
      <div class="content-wrapper">
        <div>
          <div class="title">{{ item.title }}</div>
          <div class="subtitle">{{ item.subtitle }}</div>
        </div>
        <img class="icon" :src="item.icon" alt=""/>
      </div>
    </div>
  </el-space>
</template>

<script setup lang="ts">
defineProps<{
  items: {
    name: string;
    title: string;
    subtitle: string;
    icon: string;
    action: () => void;
  }[];
}>();
</script>

<style scoped lang="scss">
.glass-card {
  padding: 20px;
  margin: 10px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  width: auto;
}

.glass-card:hover {
  transform: translateY(-5px);
}

.glass-card:hover .title {
  transform: translateX(5px);
}

.glass-card:hover .icon {
  transform: scale(1.2) rotate(10deg) translateX(10px);
}

.title {
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.icon {
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
}
</style>
